package com.liljhu30.microdianping.utils;
import com.liljhu30.microdianping.dto.UserDTO;


/**
 * @author LilJHu
 * @create 2023/12/15
 * @desc
 **/
public class UserHolder {

    private static final ThreadLocal<UserDTO> tl = new ThreadLocal<>();

    public static void saveUser(UserDTO user){
        tl.set(user);
    }

    public static UserDTO getUser(){
        return tl.get();
    }

    public static void removeUser(){
        tl.remove();
    }
}
